home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Subtraction / card_5147.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  9.2 KB  |  416 lines

  1. -- card: 5147 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2518
  5. -- name: 
  6.  
  7.  
  8. -- part 3 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=354 top=102 right=139 bottom=468
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Next Problem
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if field "Flag" = 0 then exit mouseUp
  23.   show button "Smiley"
  24.   show button "Frowney"
  25.   put empty into field "Comment"
  26.   put "  " into field "Minuend"
  27.   put "  " into field "Subtrahend"
  28.   put empty into field "Difference"
  29.   if field "Attempts" = second word of bkgnd field "Options" then
  30.     put field "Attempts" into attempts
  31.     put field "Correct" into correct
  32.     put field "Percent" into percent
  33.     put field "Name" into name
  34.     put third word of field "Options" into skill
  35.     put "O" into field "Attempts"
  36.     put "O" into field "Correct"
  37.     put "O" into field "Percent"
  38.     set the lockScreen to true
  39.     set the cursor to 4
  40.     go to first card of bkgnd "Users"
  41.     rotateData
  42.     put name into line 1 of field "name"
  43.     put the date into line 1 of field "Date"
  44.     put skill into line 1 of field "Skill"
  45.     put attempts into line 1 of field "Attempts"
  46.     put correct into line 1 of field "Correct"
  47.     put percent into line 1 of field "Percent"
  48.     pop card
  49.     exit mouseUp
  50.   end if
  51.   put the random of 9 into answer
  52.   get the random of 10
  53.   subtract 1 from it
  54.   put it into field "Subtrahend"
  55.   put answer into temp
  56.   add field "Subtrahend" to temp
  57.   if temp<10 then
  58.     put temp into char 2 of field "Minuend"
  59.   else
  60.     put temp into field "Minuend"
  61.   end if
  62.   put "0" into field "Flag"
  63. end mouseUp
  64.  
  65. on rotateData
  66.   repeat with x = 11 down to 1
  67.     if line x of field "Name" is empty then next repeat
  68.     put x into nextLine
  69.     add 1 to nextLine
  70.     get line x of field "Name"
  71.     put it into line nextLine of field "Name"
  72.     get line x of field "Date"
  73.     put it into line nextLine of field "Date"
  74.     get line x of field "Skill"
  75.     put it into line nextLine of field "Skill"
  76.     get line x of field "Attempts"
  77.     put it into line nextLine of field "Attempts"
  78.     get line x of field "Correct"
  79.     put it into line nextLine of field "Correct"
  80.     get line x of field "Percent"
  81.     put it into line nextLine of field "Percent"
  82.   end repeat
  83. end rotateData
  84.  
  85.  
  86.  
  87.  
  88. -- part 4 (button)
  89. -- low flags: 00
  90. -- high flags: 8003
  91. -- rect: left=355 top=161 right=194 bottom=388
  92. -- title width / last selected line: 0
  93. -- icon id / first selected line: 0 / 0
  94. -- text alignment: 1
  95. -- font id: 0
  96. -- text size: 12
  97. -- style flags: 0
  98. -- line height: 16
  99. -- part name: 7
  100. ----- HyperTalk script -----
  101. on mouseUp
  102.   get the length of field "Difference"
  103.   if it is 1 then exit mouseUp
  104.   put "7" into field "Difference"
  105. end mouseUp
  106.  
  107.  
  108.  
  109. -- part 5 (button)
  110. -- low flags: 00
  111. -- high flags: 8003
  112. -- rect: left=395 top=161 right=194 bottom=427
  113. -- title width / last selected line: 0
  114. -- icon id / first selected line: 0 / 0
  115. -- text alignment: 1
  116. -- font id: 0
  117. -- text size: 12
  118. -- style flags: 0
  119. -- line height: 16
  120. -- part name: 8
  121. ----- HyperTalk script -----
  122. on mouseUp
  123.   get the length of field "Difference"
  124.   if it is 1 then exit mouseUp
  125.   put "8" into field "Difference"
  126. end mouseUp
  127.  
  128.  
  129.  
  130. -- part 6 (button)
  131. -- low flags: 00
  132. -- high flags: 8003
  133. -- rect: left=435 top=162 right=194 bottom=467
  134. -- title width / last selected line: 0
  135. -- icon id / first selected line: 0 / 0
  136. -- text alignment: 1
  137. -- font id: 0
  138. -- text size: 12
  139. -- style flags: 0
  140. -- line height: 16
  141. -- part name: 9
  142. ----- HyperTalk script -----
  143. on mouseUp
  144.   get the length of field "Difference"
  145.   if it is 1 then exit mouseUp
  146.   put "9" into field "Difference"
  147. end mouseUp
  148.  
  149.  
  150.  
  151. -- part 7 (button)
  152. -- low flags: 00
  153. -- high flags: 8003
  154. -- rect: left=356 top=201 right=233 bottom=389
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 0 / 0
  157. -- text alignment: 1
  158. -- font id: 0
  159. -- text size: 12
  160. -- style flags: 0
  161. -- line height: 16
  162. -- part name: 4
  163. ----- HyperTalk script -----
  164. on mouseUp
  165.   get the length of field "Difference"
  166.   if it is 1 then exit mouseUp
  167.   put "4" into field "Difference"
  168. end mouseUp
  169.  
  170.  
  171.  
  172. -- part 8 (button)
  173. -- low flags: 00
  174. -- high flags: 8003
  175. -- rect: left=395 top=202 right=234 bottom=428
  176. -- title width / last selected line: 0
  177. -- icon id / first selected line: 0 / 0
  178. -- text alignment: 1
  179. -- font id: 0
  180. -- text size: 12
  181. -- style flags: 0
  182. -- line height: 16
  183. -- part name: 5
  184. ----- HyperTalk script -----
  185. on mouseUp
  186.   get the length of field "Difference"
  187.   if it is 1 then exit mouseUp
  188.   put "5" into field "Difference"
  189. end mouseUp
  190.  
  191.  
  192.  
  193. -- part 9 (button)
  194. -- low flags: 00
  195. -- high flags: 8003
  196. -- rect: left=435 top=201 right=233 bottom=466
  197. -- title width / last selected line: 0
  198. -- icon id / first selected line: 0 / 0
  199. -- text alignment: 1
  200. -- font id: 0
  201. -- text size: 12
  202. -- style flags: 0
  203. -- line height: 16
  204. -- part name: 6
  205. ----- HyperTalk script -----
  206. on mouseUp
  207.   get the length of field "Difference"
  208.   if it is 1 then exit mouseUp
  209.   put "6" into field "Difference"
  210. end mouseUp
  211.  
  212.  
  213.  
  214. -- part 10 (button)
  215. -- low flags: 00
  216. -- high flags: 8003
  217. -- rect: left=356 top=242 right=274 bottom=389
  218. -- title width / last selected line: 0
  219. -- icon id / first selected line: 0 / 0
  220. -- text alignment: 1
  221. -- font id: 0
  222. -- text size: 12
  223. -- style flags: 0
  224. -- line height: 16
  225. -- part name: 1
  226. ----- HyperTalk script -----
  227. on mouseUp
  228.   get the length of field "Difference"
  229.   if it is 1 then exit mouseUp
  230.   put "1" into field "Difference"
  231. end mouseUp
  232.  
  233.  
  234.  
  235. -- part 11 (button)
  236. -- low flags: 00
  237. -- high flags: 8003
  238. -- rect: left=395 top=241 right=273 bottom=428
  239. -- title width / last selected line: 0
  240. -- icon id / first selected line: 0 / 0
  241. -- text alignment: 1
  242. -- font id: 0
  243. -- text size: 12
  244. -- style flags: 0
  245. -- line height: 16
  246. -- part name: 2
  247. ----- HyperTalk script -----
  248. on mouseUp
  249.   get the length of field "Difference"
  250.   if it is 1 then exit mouseUp
  251.   put "2" into field "Difference"
  252. end mouseUp
  253.  
  254.  
  255.  
  256. -- part 12 (button)
  257. -- low flags: 00
  258. -- high flags: 8003
  259. -- rect: left=436 top=242 right=274 bottom=468
  260. -- title width / last selected line: 0
  261. -- icon id / first selected line: 0 / 0
  262. -- text alignment: 1
  263. -- font id: 0
  264. -- text size: 12
  265. -- style flags: 0
  266. -- line height: 16
  267. -- part name: 3
  268. ----- HyperTalk script -----
  269. on mouseUp
  270.   get the length of field "Difference"
  271.   if it is 1 then exit mouseUp
  272.   put "3" into field "Difference"
  273. end mouseUp
  274.  
  275.  
  276.  
  277. -- part 13 (button)
  278. -- low flags: 00
  279. -- high flags: 8003
  280. -- rect: left=355 top=281 right=313 bottom=407
  281. -- title width / last selected line: 0
  282. -- icon id / first selected line: 0 / 0
  283. -- text alignment: 1
  284. -- font id: 0
  285. -- text size: 12
  286. -- style flags: 0
  287. -- line height: 16
  288. -- part name: 0
  289. ----- HyperTalk script -----
  290. on mouseUp
  291.   get the length of field "Difference"
  292.   if it is 1 then exit mouseUp
  293.   put "0" into field "Difference"
  294. end mouseUp
  295.  
  296.  
  297.  
  298. -- part 14 (button)
  299. -- low flags: 00
  300. -- high flags: 8003
  301. -- rect: left=414 top=281 right=313 bottom=468
  302. -- title width / last selected line: 0
  303. -- icon id / first selected line: 0 / 0
  304. -- text alignment: 1
  305. -- font id: 0
  306. -- text size: 12
  307. -- style flags: 0
  308. -- line height: 16
  309. -- part name: Enter
  310. ----- HyperTalk script -----
  311. on mouseUp
  312.   global answer
  313.   if field "Difference" < 0 then exit mouseUp
  314.   if field "Flag" > 0 then exit mouseUp
  315.   put field "Minuend" into answer
  316.   subtract field "Subtrahend" from answer
  317.   add 1 to field "Attempts"
  318.   if field "Difference" = answer then
  319.     add 1 to field "Correct"
  320.     get field "Correct"
  321.     divide it by field "Attempts"
  322.     multiply it by 100
  323.     put round(it) into field "Percent"
  324.     celebrate
  325.   else
  326.     get field "Correct"
  327.     divide it by field "Attempts"
  328.     multiply it by 100
  329.     put round(it) into field "Percent"
  330.     nag
  331.   end if
  332. end mouseUp
  333.  
  334. on celebrate
  335.   put "Correct" into line 1 of field "Comment"
  336.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  337.   hide button "Smiley"
  338.   put "1" into field "Flag"
  339.   if first word of bkgnd field "Options" = "Y" then
  340.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  341.   end if
  342. end celebrate
  343.  
  344. on nag
  345.   global answer
  346.   put "WRONG!" into line 1 of field "Comment"
  347.   put "The answer is "& answer & "." into line 3 of field "Comment"
  348.   hide button "Frowney"
  349.   put "2" into field "Flag"
  350.   if first word of bkgnd field "Options" = "Y" then
  351.     play "boing" tempo 200 "gq c e a"
  352.   end if
  353. end nag
  354.  
  355.  
  356.  
  357. -- part 15 (button)
  358. -- low flags: 00
  359. -- high flags: 0001
  360. -- rect: left=33 top=190 right=281 bottom=132
  361. -- title width / last selected line: 0
  362. -- icon id / first selected line: 0 / 0
  363. -- text alignment: 1
  364. -- font id: 0
  365. -- text size: 12
  366. -- style flags: 0
  367. -- line height: 16
  368. -- part name: Smiley
  369.  
  370.  
  371. -- part 16 (button)
  372. -- low flags: 00
  373. -- high flags: 0001
  374. -- rect: left=226 top=195 right=288 bottom=329
  375. -- title width / last selected line: 0
  376. -- icon id / first selected line: 0 / 0
  377. -- text alignment: 1
  378. -- font id: 0
  379. -- text size: 12
  380. -- style flags: 0
  381. -- line height: 16
  382. -- part name: Frowney
  383.  
  384.  
  385. -- part contents for background part 1
  386. ----- text -----
  387.   
  388.  
  389. -- part contents for background part 4
  390. ----- text -----
  391. 1
  392.  
  393. -- part contents for background part 6
  394. ----- text -----
  395. O
  396.  
  397. -- part contents for background part 7
  398. ----- text -----
  399. O
  400.  
  401. -- part contents for background part 8
  402. ----- text -----
  403. O
  404.  
  405. -- part contents for background part 10
  406. ----- text -----
  407. Y 10 2
  408.  
  409. -- part contents for background part 11
  410. ----- text -----
  411. larry
  412.  
  413.  
  414. -- part contents for background part 3
  415. ----- text -----
  416.